package thread;

/**
 * 以匿名内部类的形式完成线程的两种创建
 */

public class ThreadDemo3 {
    public static void main(String[] args) {

        Thread T1=new Thread(){
            public void run(){
                System.out.println("你好");
            }
        };
/*
        Runnable r2=new Runnable() {
            @Override
            public void run() {
                System.out.println("hello");
            }
        };*/
        Runnable r2=()-> System.out.println("hello");
        Thread T2=new Thread(r2);

        T1.start();
        T2.start();
    }
}
